package cool.taomu.toolkit.lmdb

import com.google.auto.service.AutoService
import com.google.inject.AbstractModule
import com.google.inject.TypeLiteral
import cool.taomu.toolkit.TaomuConfigure
import cool.taomu.toolkit.inter.IStoreKeyValue
import cool.taomu.toolkit.platform.inter.IPlatform
import java.nio.ByteBuffer
import org.lmdbjava.Env

@AutoService(IPlatform)
class LmdbPlugin implements IPlatform {

	override note() {
		"Lmdb 插件"
	}

	override packages() {
	}

	override module(TaomuConfigure configure) {
		new AbstractModule() {
			override configure() {
				bind(new TypeLiteral<Env<ByteBuffer>>() {
				}).toProvider(LmdbProvider)
				bind(new TypeLiteral<IStoreKeyValue<String, byte[]>>() {
				}).to(LmdbStore);
			}
		}
	}

	override start() {
	}

	override init() {
	}

}
